package com.example.eurekaclientribbon;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@org.springframework.web.bind.annotation.RestController
public class RestController {
    @Autowired
    private DiscoveryClient discoveryClient;

  @RequestMapping("test")
  String test() {
      if(true){
          throw new RuntimeException();
      }
      List<ServiceInstance> instances =  discoveryClient.getInstances("eureka-client-ribbon");
        return "test-ribbon";
    }

}
